<link href="../Public/css/skin.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="../Public/js/jquery-1.4.3.min.js"></script>


<title>选择商品</title>

<script language="javascript">

	function saveGoods(){
		var gid = GetRadioValue("gid");
		var gnameLab = gid + "_gname";
		var gname = document.getElementById(gnameLab).value;
		
		window.opener.saveGoods(gid,gname);   //选择商品信息
		window.close();
	}

	
	
	/**
	 获取radio值
	*/
	function GetRadioValue(RadioName){
	    var obj;    
	    obj=document.getElementsByName(RadioName);
	    if(obj!=null){
	        var i;
	        for(i=0;i<obj.length;i++){
	            if(obj[i].checked){
	                return obj[i].value;            
	            }
	        }
	    }
	    return null;
	}



</script>

<body style="overflow: auto">

<form method="post" id="goods" action="__URL__/viewGoods">

    <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" class="content">
    
        <tr class="tr_title">
            <td width=5%>选择</td>
         	<td width="45%">商品名称</td>
			<td width="10%">所属分类</td>
        </tr>
        
    <iterate name="goodsdata" id="v">
        <tr class="tr_content">
            <td>
                <input type="radio" name="gid" value="{$v.id}"  />
                <input type="hidden" id="{$v.id}_gname" name="{$v.id}_gname"   value="{$v.goodsname}"  />
            </td>
            <td>{$v.goodsname}</td>
			<td>{$v.categoryname|default="无"}</td>
        </tr>
    </iterate>
    
    <tr>
        <td colspan="3">
         <a href="javascript:saveGoods();" class="operation_submit" ></a>  
        </td>
    </tr>
    
    
    </table>
</form> 


</body>